<?php 
use yii\helpers\Html;
use yii\web\View;
use app\models\User;
use yii\helpers\Url;
$id = Yii::$app->user->getId();
$object=User::findIdentity($id);
 ?>
 <!DOCTYPE html>
 <?php $this->beginPage() ?> 
 <html>
 <head>
  <?= Html::csrfMetaTags() ?>
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <!-- Compiled and minified CSS -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">

  <!-- Compiled and minified JavaScript -->
  <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
   
     <title></title>
 </head>
 <body>
    <?php $this->beginBody() ?> 
   <!-- Navbar goes here -->

    <!-- Page Layout here -->
    <div class="row">

      <div class="col s12 m3 l2" style="padding:0px"> 

            <div class="collection" style="margin: 0px;position: absolute;width: inherit; ">
                
             <a class="collection-item "><h4 class="center-align">zblog后台管理</h4></li>
             <a href="<?= Url::to(['admin/index']) ?>" class="collection-item">仪盘表</a>
             <a href="<?= Url::to(['admin/article']) ?>" class="collection-item ">技术笔记</a>
             <a href="<?= Url::to(['admin/live']) ?>" class="collection-item ">生活</a>
             <a href="<?= Url::to(['admin/album']) ?>" class="collection-item">媒体库</a>
             <a href="<?= Url::to(['admin/comment']) ?>" class="collection-item">笔记评论</a>
             <a href="<?= Url::to(['admin/comment-live']) ?>" class="collection-item">生活评论</a>
             <a href="<?= Url::to(['admin/user']) ?>" class="collection-item">用户</a>
             <a href="<?= Url::to(['admin/setting']) ?>" class="collection-item">设置</a>
           </div>
 

      </div>

      <div class="col s12 m9 l10" style="padding: 0px"> 
        <nav>
    <div class="nav-wrapper" style="background: #00838f">
    
    <ul id="nav-mobile" class="hide-on-med-and-down right">
      <li><a href="#"><?php  echo $object->username  ?></a></li>
      <li><a href="#" onclick="firm(this)">退出</a></li>
      
    </ul>
    </div>
  </nav>
  
<?php echo $content;?>


      </div>

    </div>
 

 
<script type="text/javascript">
 function firm(obj) {  

        //利用对话框返回的值 （true 或者 false）  
        if (confirm("你确定退出吗？")) {  
           
         
           
            $.post("<?= Url::to(['admin/logout']) ?>",{},function(result){
            alert(result);
            location.reload();
          });
            
        }  
        else {  
           
        }  
  
    }
</script>

 <script type="text/javascript">
     $(document).ready(function(){
     $('.collapsible').collapsible({
       accordion : false // A setting that changes the collapsible behavior to expandable instead of the default accordion style
     });
   });
     $(document).ready(function(){
      var height =$(document).height();
     // var height = $(window).height();
     $(".collection").css("height",height);
   });
$(document).ready(function() {
    $('select').material_select();
  });
  $(document).ready(function(){
    $('.materialboxed').materialbox();
  });
 </script>
 <?php $this->endBody() ?>
 </body>

 </html>
 <?php $this->endPage() ?>